package com.hexu.event.controller;

import com.hexu.event.dao.ArticleSpecieDao;
import com.hexu.event.entity.Specie;
import jakarta.servlet.*;
import jakarta.servlet.http.*;

import java.io.IOException;
import java.util.List;

public class SpecieFindServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        ArticleSpecieDao articleSpecieDao = new ArticleSpecieDao();
        //调用DAO对象将查询命令推送到数据库中得到所有分类
        List<Specie> specieList = articleSpecieDao.getSpecie();
        //通过请求转发，向Tomcat索要specieDelete.jsp，将试题信息写入到响应体
        request.setAttribute("key", specieList);
        request.getRequestDispatcher("/SpecieFind.jsp").forward(request, response);
    }


}
